<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@page import = "com.myweb.DBTools" %> 
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>菜品新增和修改</title>
</head>
<body>

<h2>菜品详情</h2>

<%

request.setCharacterEncoding("utf-8");
String dish_id="",name="",price="";
javax.sql.rowset.WebRowSet rs = com.myweb.DBTools.getRS("SELECT * FROM dishes WHERE dish_id=" + request.getParameter("dish_id"));
while(rs.next()){
	dish_id = rs.getString("dish_id");
	name = rs.getString("name");
	price = rs.getString("price");
	
}
rs.close();
%>
<form action="save.jsp" method="post">

<label for="dish_id">dish_id</label>
<input type="text" id="dish_id" name="dish_id" value="<%=dish_id %>" readonly><br>
<label for="name">菜品名</label>
<input type="text" id="name" name="name" value="<%=name %>" ><br>
<label for="price">价格</label>
<input type="text" id="price" name="price" value="<%=price %>" ><br>
<input type="submit" name="btn" value="修改">
<input type="submit" name="btn" value="新增"><br>

</form>

</body>
</html>